﻿using Autofac;
using MahApps.Metro.Controls;
using PLCWpfTest.ViewModels;
using YWM;

namespace PLCWpfTest.Views
{
    /// <summary>
    /// UserPasswordWindow.xaml 的交互逻辑
    /// </summary>
    public partial class UserPasswordWindow : MetroWindow
    {
        private readonly UserPasswordViewModel _userPasswordViewModel;
        public UserPasswordWindow(long id)
        {
            InitializeComponent();
            DataContext = _userPasswordViewModel = YApp.Resolve<UserPasswordViewModel>(new NamedParameter("id", id));
            _userPasswordViewModel.RequestClose += _userPasswordViewModel_RequestClose;
        }

        private void _userPasswordViewModel_RequestClose()
        {
            DialogResult = true;
            Close();
        }
    }
}
